<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<style type="text/css">
    input{
        height: 30px;
    }
    #test1{
        width: 300px;
    }
    #a{
        text-decoration:none;
    }
</style>
<body>
<div>首页/预约信息管理</div><hr />
<form id="myForm">
    <table border="1px" width="600px"rules="rows" height="350px">
        <tr align="center">
            <td colspan="2"><b>请添加新预约信息</b></td>
        </tr>
        <tr align="center">
            <td>请输入预约人：</td>
            <td>
                <input type="text" id="test1" name="makeanappointmentname"/>
            </td>
        </tr>
        <tr align="center">
            <td>请输入电话号码：</td>
            <td>
                <input type="text" id="test1" name="makeanappointmentphone"/>
            </td>
        </tr>
        <tr align="center">
            <td colspan="2">
                <input type="button" value="添加" id="agreementSub" />
                <a href="/admin/makenanappointment.html" id="a"><input type="button" value="返回"/></a>
            </td>
        </tr>
        <tbody id="TableData" class="datas">

        </tbody>
    </table>
</form>
</body>
<script type="text/javascript" src="assets/js/jquery-2.1.1.min.js"></script>
<script type="text/javascript">
    $("#agreementSub").click(function () {
        $("#TableData").empty();
        $.ajax({
            type: "POST",   //提交的方法
            url:"/addAppointment", //提交的地址
            data:$('#myForm').serialize(),// 序列化表单值
            async: false,
            success: function(data) {  //成功
                // $("#TableData").append("<tr align='center'><td colspan='2'><span>"+data+"</span></td></tr>")
                // alert(data);
                // $("input[name=servicetypename]").val("");
                // $("input[name=servicetypeserviceprice]").val("");
                // $("textarea[name=servicetypemark]").val("");
            }
        });
    });
</script>
</html>
